package com.hongdee.scm.certificate.service.impl;

import com.hongdee.scm.certificate.dao.ITCrmCarCertificateDao;
import com.hongdee.scm.certificate.entity.TCrmCarCertificate;
import com.hongdee.scm.certificate.service.ITCrmCarCertificateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Calendar;

/**
 * 名  称:TCrmCarCertificateServiceImpl
 * 类  型:class
 * 描  述:
 * 路  径:com.hongdee.crm.certificate.service.impl
 * 作  者: 术洪超
 * 日  期:2017-06-13 15:21
 */
@Service
public class TCrmCarCertificateServiceImpl implements ITCrmCarCertificateService {


    @Autowired
    private ITCrmCarCertificateDao itCrmCarCertificateDao;


    /**
     * @param data 要保存的实体
     * @return Map
     * @throws Exception
     * @desc 保存添加的实体内容
     * @author 术洪超
     */

    @Override
    public boolean saveOrUpdate(TCrmCarCertificate data, String uid) throws Exception {

        try
        {
            data.setCreateUser(uid);
            data.setCreateTime(Calendar.getInstance().getTimeInMillis());
            this.itCrmCarCertificateDao.saveOrUpdate(data);
        }
        catch (Exception e)
        {
            return false;
        }


        return true;
    }
}
